//
//  UIImageView+ProfileImage.m
//  百思不得姐
//
//  Created by 胥鸿儒 on 16/6/20.
//  Copyright © 2016年 xuhongru. All rights reserved.
//

#import "UIImageView+ProfileImage.h"
#import <UIImageView+WebCache.h>
#import "UIImage+ProfileImage.h"
@implementation UIImageView (ProfileImage)

- (void)setProfileImageWithImageURLPath:(NSString *)imageURL
{
    [self sd_setImageWithURL:[NSURL URLWithString:imageURL] placeholderImage:[UIImage imageNamed:@"defaultUserIcon"] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
        
        image?[image profileImageWithProfileImageBlock:^(UIImage *image) {
            self.image = image;
        }]:[[UIImage imageNamed:@"defaultUserIcon"]profileImageWithProfileImageBlock:^(UIImage *image) {
            self.image = image;
        }];
    }];
}

@end
